<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>订单管理</title>
<%@include file="/pages/common/head.jsp"%>
	<script type="text/javascript">
		$(function () {
			$("a.sendOrder").click(function () {
				return confirm("是否为用户发货?");
			});
		});
	</script>
</head>
<body>
	
	<div id="header">
			<img class="logo_img" alt="" src="static/img/logo.gif" >
			<span class="wel_word">订单管理系统</span>
		<%@include file="/pages/common/manager.jsp"%>
	</div>
	
	<div id="main">
		<table>
			<tr>
				<td>用户</td>
				<td>日期</td>
				<td>金额</td>
				<td>详情</td>
				<td>发货</td>
			</tr>
			<c:forEach items="${sessionScope.orders}" var="order">
			<tr>
				<td>${order.userId}</td>
				<td>${order.createTime}</td>
				<td>${order.price}</td>
				<td><a href="orderServlet?action=showOrderDetail&orderId=${order.orderId}&userId=${order.userId}">查看详情</a></td>
				<td>
					<c:if test="${order.status == 0}"><a class="sendOrder" href="orderServlet?action=sendOrder&orderId=${order.orderId}&userId=${order.userId}">点击发货</a></c:if>
					<c:if test="${order.status == 1}"><span>已发货</span></c:if>
					<c:if test="${order.status == 2}"><span>已收货</span></c:if>
				</td>
			</tr>
			</c:forEach>
		</table>
		<%@include file="/pages/common/page_nav.jsp"%>
	</div>
	<%@include file="/pages/common/last.jsp"%>
</body>
</html>